*Table 1: Gender Gaps by Periods that Differ in their Competitiveness Level*
clear all
use Clean_data, clear


********************************T1.GENDEREMF_byPERIODS****************

***1-PREP. COMPETITION PERIODS***
{
gen veryhigh_comp_A=.
replace veryhigh_comp_A=1 if year>=1983 & year<=1988
replace veryhigh_comp_A=0 if  year>=1989

gen high_comp_A=.
replace high_comp_A=1 if year>=1989 & year<=2002
replace high_comp_A=0 if  year>=2003 | year<1989

gen low_comp_A=.
replace low_comp_A=1 if year>=2003 & year<=2011
replace low_comp_A=0 if year<2003 | year>2012

gen medium_comp_A=.
replace medium_comp_A=1 if year>=2012 
replace medium_comp_A=0 if year<2012
}

***2- RUN REGRESSIONS***

reg dropout female##medium_comp_A female##high_comp_A female##veryhigh_comp_A z_GPA   if degree=="M" & z_GPA!=. & foreign==0 , robust 

global test_ z_answered z_test_correct  

foreach x in $test_ {
reg `x'  female##medium_comp_A female##high_comp_A female##veryhigh_comp_A z_GPA  if degree=="M" & test==1 & (year<1987 | year>1988) & z_GPA!=.  & foreign==0, robust
}

global notest_ z_test_points z_total_points position
foreach x in $notest_ {
reg `x'  female##medium_comp_A female##high_comp_A female##veryhigh_comp_A z_GPA  if degree=="M" & test==1 & z_GPA!=. & foreign==0 ,robust
}
